Repository navigation
sofima-stitch-fix-20261201 - #265
Merged
Merged
Conversation
…nd any StageCreepCorrectionTransform (if one exists). The stitch fix data was not built with any creep correction transform.
There was a problem hiding this comment.
🟡 Changes recommended
Empty replacement transform lists can remove affine and creep corrections without installing a stitch fix, allowing stacks with incorrect tile placement to be saved.
3 open issues
What changed in this PR
Adds optional SOFIMA stitch corrections during import, applying restitched tile transforms before the slab’s 3D displacement field.
Changes:
- Adds
stitchFixUriconfiguration. - Loads and checks per-layer replacement transforms.
- Applies stitch fixes while retaining the initial exponential transform and replacing affine and creep corrections.
| File | Description |
|---|---|
render-ws-java-client/src/main/java/org/janelia/render/client/parameter/SofimaParameters.java |
Adds stitch-fix configuration and slab-name extraction. |
render-ws-java-client/src/main/java/org/janelia/render/client/multisem/SofimaStitchFix.java |
Loads, validates, and applies layer-specific stitch fixes. |
render-ws-java-client/src/main/java/org/janelia/render/client/multisem/ImportSofimaClient.java |
Integrates stitch fixes before adding the 3D field. |
Review effort: Balanced
…ust now be exactly [DisplacementFieldTransform, AffineModel2D], both as leaf transforms. Otherwise loading fails with a message naming the image URL and the file. Because this happens during loading, a bad entry stops the import before the target stack is even created.
Collaborator
Author
|
@minnerbe - please continue to post any review comments here and I will address them in a separate pull request. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Apply SOFIMA stitch fixes during the SOFIMA import
Some w61 slabs had stitching problems in individual layers. Those layers were restitched with SOFIMA, and each slab's 3D SOFIMA field was then recomputed. This PR adds an optional step to the SOFIMA import that applies the restitched tile transforms before the slab's 3D displacement field is appended.
Usage
Add --stitchFixUri (or stitchFixUri in the pipeline JSON's sofima block):
The URI points at a directory holding a manifest.json, which lists the fixed layers, and one _layer/transforms.json per layer. Each transforms.json maps a tile's mipmap level 0 imageUrl to a replacement spec list: a tile-local DisplacementFieldTransform (scale=20.0, one z-slice per tile in a Precomputed volume) followed by a translation-only AffineModel2D.
Slabs without fixes, and runs without stitchFixUri, import exactly as before.
How a fixed layer is changed
For each tile in a fixed layer:
The import then appends the 3D DisplacementFieldTransform as usual. A StageCreepCorrectionTransform, which appears in early layers, is replaced along with the affine. The restitching worked on tiles with only the exponential offset applied, so the stitch fix field already accounts for creep.